/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/* Copyright 2008 Uppsala University
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 *     
 *     http://www.apache.org/licenses/LICENSE-2.0 
 *
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License.
 */ 
#ifndef _LIBHAGGLE_METADATA_XML_H
#define _LIBHAGGLE_METADATA_XML_H

#ifdef __cplusplus
extern "C" {
#endif

/**
  "metadata_xml" implements an XML-based backend for the wire format
  of metadata.
*/
#include "metadata.h"

#define HAGGLE_XML_TAG "<" HAGGLE_TAG "/>"

metadata_t *metadata_xml_new_from_xml(const char *raw, size_t len);
int metadata_xml_get_raw_alloc(metadata_t *m, unsigned char **buf, size_t *len);

#define metadata_new_from_raw(raw, len) metadata_xml_new_from_xml((char *)(raw), (len))
#define metadata_get_raw_alloc(m, buf, len) metadata_xml_get_raw_alloc((m), (buf), (len))

#ifdef __cplusplus
}
#endif

#endif /* _LIBHAGGLE_METADATA_XML_H */
